package com.wy;

import com.wy.util.HttpClientHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.PostConstruct;
import java.io.IOException;

/**
 * @author wangyu
 * @Description
 * @create 2020-06-22 17:16
 */

@RestController
@RequestMapping("/spider")
public class SpiderController {
    @Autowired
    private HttpClientHelper httpClientHelper;
    @GetMapping("/{test}")
    private String demo(@PathVariable("test") String url){
        try {
            System.out.println(url);
            String s = httpClientHelper.sendGet("http://47.114.139.22:8080/test/hello");
            return s;
        } catch (IOException e) {
            e.printStackTrace();
            return toString();
        }
    }
}
